/**
 * @file RemoveContactHandler.cs
 * @author Zane Mayo
 * @date 21/5/2009
 */

using System;

namespace MxitAPI {
	
	
	public class RemoveContactHandler : Handler {
		
		private static log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod().DeclaringType );
		
		private int contactId;
		
		public RemoveContactHandler() : base( typeof( RemoveContactProtocolMessage ) ) {
		}
		
		public RemoveContactHandler( int contactId ) : this() {
			this.contactId = contactId;
		}
		
		public override ProtocolMessage CreateRequestProtocolMessage ()
		{
			log.DebugFormat( "ContactId [{0}]", contactId );
			
			RemoveContactProtocolMessage protocolMessage =  new RemoveContactProtocolMessage();
			protocolMessage.ContactAddress = Contacts.Instance.GetContact( contactId ).ContactAddress;
			
			return protocolMessage;
		}

		
	}
}
